<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>示例0</title>
    <script src="jquery.js"></script>
    <script>
        function show1(){
           // const lis = document.getElementsByTagName("li")
           //  for (const li of lis) {
           //      li.style.backgroundColor = 'red'
           //  }
            $('li.red').css('background-color','blue')
            // console.log($('li'))
            //  document.getElementsByClassName("red")[0].style.backgroundColor = 'red'
            // $('.red').css('background-color','blue')

            console.log($('.red'))
            console.log($('.red').length)
        }
    </script>
</head>
<body>
    <ul>
        <li>accp1</li>
        <li>accp2</li>
        <li class="red">accp3</li>
        <li>accp4</li>
        <li>accp5</li>
    </ul>
    <button onclick="show1()">变色</button>
</body>
</html>